package com.lmabbe.core.service.impls;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lmabbe.core.common.entitys.SysUserRole;
import com.lmabbe.core.common.interfaces.SysUserRoleService;
import com.lmabbe.core.service.dao.SysUserRoleMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;

import java.util.List;

/**
 * @author lmabbe
 */
@Slf4j
@DubboService(provider = "simple-dubbo")
public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleMapper, SysUserRole> implements SysUserRoleService {

    @Override
    public List<SysUserRole> getRoleByUserId(Long userId) {
        return baseMapper.selectList(baseMapper.createIgnoreDataScopeWrapper().eq(SysUserRole::getUserId, userId));
    }
}
